package com.zd.commodity.productMng.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.zd.commodity.dao.impl.BaseDao;
import com.zd.commodity.productMng.dao.IProductAttrMappingDao;
import com.zd.commodity.productMng.entity.ProductAttrGroup;
import com.zd.commodity.productMng.entity.ProductAttrMapping;
@Repository
public class ProductAttrMappingDao extends BaseDao<ProductAttrMapping>
		implements IProductAttrMappingDao {
	@Resource(name = "sessionFactory")
	public void setSuperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}

	@Override
	public DetachedCriteria getDetachedCriteria(ProductAttrMapping t1,
			ProductAttrMapping t2, Object param) {
		DetachedCriteria dc=DetachedCriteria.forClass(ProductAttrMapping.class);
		if(t1!=null){
			if(t1.getMAttrId()!=null){
				dc.add(Restrictions.eq("MAttrId", t1.getMAttrId()));
			}
		}
		return dc;
	}


}
